home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 6⁄22⁄90 / 1475-MacApp 2.0 Bugs⁄Prob-Jun90 < prev    next >
Encoding:
Text File  |  1990-06-25  |  3.4 KB  |  100 lines  |  [TEXT/GEOL]

  1. Item    0272738                         21-June-90        07:07PDT
  2.  
  3. From:   CDA0220                         DEV Bell Northern Resrch,B Papp,IDV
  4.  
  5. To:     APPLE.BUGS                      Apple Bugs Reporting
  6.         MACAPP.TEST                     MacApp SQA Team
  7.         MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    MacApp 2.0 Bugs/Problems
  10.  
  11. Hi,
  12.  
  13. We have just converted a large MacApplication from 2.0b9 to 2.0.
  14. We started from the release notes and made appropriate changes. Overall, things
  15. went smoothly.These bugs and undocumented changes bit us:
  16.  
  17. 1) MacApp source will not compile
  18.  
  19. After applying the two patches listed in the release notes, we did a full
  20. MacApp build and discovered that UDialog would not compile with MPW 3.1. This
  21. definition must be added to TIcon.Draw:
  22.  
  23.    TYPE BitMapPtr = ^BitMap;
  24.  
  25. Also, there are typos in the TView.Focus patch in the release notes: vh and vhs
  26. are reversed.
  27.  
  28. 2) GetSameItemNo fails in debug if looking for NIL.
  29.  
  30. With previous versions of MacApp, it was perfectly acceptable to check for a
  31. NIL object in a list. GetSameItemNo would return 0, as expected. With 2.0,
  32. there is an explicit check in debug mode that the object is valid so NIL
  33. doesn't work. We now end up coding:
  34.  
  35. IF obj = NIL then
  36.     index := 0
  37. ELSE
  38.     index := GetSameItemNo(obj)
  39.  
  40. 3) TCommand.TrackMouse bombs on mouse up if fView is NIL.
  41.  
  42. Other parts of TCommand check that fView is non-nil before referencing it.
  43.  
  44. The offending line is:
  45.    IF (aTrackPhase = trackRelease) & (NOT fView.ContainsMouse(nextPoint)) THEN
  46. which we changed to:
  47.    IF (aTrackPhase = trackRelease) & (fView <> NIL) & (NOT
  48. fView.ContainsMouse(nextPoint)) THEN
  49.  
  50. 4) TPopup.DrawPopupBox can loop endlessly and trash memory.
  51.  
  52. When drawing the popup box, MacApp 2.0 checks that the text will fit and if
  53. not, removes characters and appends a trailing ellipses until it will fit. The
  54. problem which we encountered occurs with a dynamic menu which initially has no
  55. entries.
  56.  
  57. DrawPopupBox tries to render an empty string, as it should. When it calculates
  58. the size it needs, it gets 0 and notices that this won't fit in the box which
  59. it calculates as having a negative width, due to the slop values.
  60.  
  61. The code that removes trailing characters is:
  62.    newLen := Length(theItem);
  63.    REPEAT
  64.    theItem[newLen] := '…';
  65.    theItem[0] := CHR(newLen);
  66.    newWid := StringWidth(theItem);
  67.    newLen := PRED(newLen);
  68.    UNTIL (newWid <= wid) | (newLen = 0);
  69.  
  70. When newLen is 0, this delightful loop fills memory with ellipses, working
  71. backwards from the length byte of theItem. Eventually, the application heap is
  72. sufficiently trashed to cause an exception.
  73.  
  74. We added this line before the repeat:
  75.    IF newLen > 0 THEN
  76.  
  77. 5) Rendering of StaticText has changed so that underlying area is not erased.
  78.  
  79. MacApp 2.0b9 erased area under text before drawing. We relied on this when
  80. adding a second label to a cluster border. We now use a descendant of
  81. TStaticText with this override:
  82.  
  83. PROCEDURE TEraseUnderStaticText.ImageText(text: Ptr; Length: LONGINT; box:
  84. Rect; just: INTEGER); OVERRIDE;
  85.  
  86.    BEGIN
  87.    MATextBox(text, Length, box, just, fAutoWrap, NIL, kEraseFirst,
  88. kSpaceForCaret);
  89.    END;
  90.  
  91. 6) TPopup no longer calls DoChoice if the same item is re-selected.
  92.  
  93. This broke part of our application which uses a descendant of TPopup for
  94. pull-down menus. Fix was to set fCurrentItem to 0 after DoChoice.
  95.  
  96. Regards,
  97. Gordon Eastman
  98. Bell-Northern Research
  99.  
  100.